<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" lang="zh-CN">

<div th:fragment="main">
    <div class="container">
        <nav class="navbar navbar-expand-md bg-dark navbar-dark">
            <!-- Brand -->
            <a class="navbar-brand" href="#">NewBee商城</a>

            <!-- Toggler/collapsibe Button -->
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#collapsibleNavbar">
                <span class="navbar-toggler-icon"></span>
            </button>

            <!-- Navbar links -->
            <div class="collapse navbar-collapse" id="collapsibleNavbar">
                <ul class="navbar-nav">
<!--                    <li class="nav-item">-->
<!--                        <a class="nav-link" href="#">我的购物车</a>-->
<!--                    </li>-->
<!--                    <li class="nav-item">-->
<!--                        <a class="nav-link" href="#">条目2</a>-->
<!--                    </li>-->
<!--                    <li class="nav-item">-->
<!--                        <a class="nav-link" href="#">条目3</a>-->
<!--                    </li>-->

                    <th:block th:if="${session.CUSTOMER!=null}">
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                欢迎来到NewBee商城：<span th:text="${session.CUSTOMER.nick}"></span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" th:href="@{/cart/product/newPage}">【首页】</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" th:href="@{/cart/product/goCart}">【购物车】</a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" th:href="@{/front/logout}">【注销】</a>
                        </li>
                    </th:block>

                    <th:block th:if="${session.CUSTOMER==null}">
                        <li class="nav-item">
                            <a class="nav-link" th:href="@{/front/login}">【去登录】</a>
                        </li>
                    </th:block>
                </ul>
            </div>
        </nav>
    </div>

</div>
